import http from "../../utils/http"
export interface managerItem{
    _id?: string,
    name?:string,
    account?:string,
    password?:string,
    role?:roleItem,
    state?:number
}
interface roleItem{
    _id?:string,
    name?:string
    permissions?:string[]
    state?:number
}

export interface formItem{
    account?:string
    password?:string
}
const adminList = {
    // 查询用户分组数据
    // search: (data?: object) => http.post('/userGroups/search', data),
    search:function(data?: object){
        return  http.post('/admins/search', data)
    },
    // // 新增用户分组数据
    add: (data:managerItem ) => http.post('/admins/add', data),
    // // 删除用户分组数据
    remove: (data: object) => http.delete('/admins/remove', data),
    // // 修改用户分组数据
    update: (data: managerItem) => http.put('/admins/update', data),
    // 登录
    login: (data:formItem) => http.post('/admins/login', data),
    // 获取信息
    getInfo: (data?:object) => http.get('/admins/getDetail', data)
}

export default adminList